package wsz.rocketMq.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import wsz.rocketMq.service.PhoneService;

/**
 * @author wsz
 * @date 2022/3/2 12:32
 **/
@Controller
@RequestMapping("/")
public class IndexController {

    @Autowired
    private PhoneService phoneService;

    @GetMapping("")
    public String index(Model model) {
        model.addAttribute("phoneList", phoneService.findAll());
        return "index";
    }
}
